﻿using System;
using AutomatedAcceptanceTests.Enums;

namespace AutomatedAcceptanceTests.Extensions
{
    public static class WebDriverTypeExtensions
    {
        public static WebDriverType GetWebDriverType(this WebDriverType webDriverType, string webDriverStringValue)
        {
            WebDriverType webDriver = WebDriverType.FireFox;
            if (Enum.TryParse<WebDriverType>(webDriverStringValue, true, out webDriver))
            {
                return webDriver;
            }
            throw new InvalidOperationException("This operation is not possible on provided webDriverStringValue");
        }
    }
}